package com.unionpay.mpds.model;

// default package

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Menu entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "T_MENU", uniqueConstraints = @UniqueConstraint(columnNames = "MENU_ID"))
public class Menu implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -7777353735646012373L;
	private String menuId;
	private String menuName;
	private String menuStatus;
	private String menuLevel;
	private String menuIdP;
	private String menuUrl;
	private String menuIcon3;
	private String menuIcon2;
	private String menuIcon1;

	// Constructors

	/** default constructor */
	public Menu() {
	}

	/** minimal constructor */
	public Menu(String menuId, String menuName, String menuStatus,
			String menuLevel, String menuIdP) {
		this.menuId = menuId;
		this.menuName = menuName;
		this.menuStatus = menuStatus;
		this.menuLevel = menuLevel;
		this.menuIdP = menuIdP;
	}

	/** full constructor */
	public Menu(String menuId, String menuName, String menuStatus,
			String menuLevel, String menuIdP, String menuUrl, String menuIcon3,
			String menuIcon2, String menuIcon1) {
		this.menuId = menuId;
		this.menuName = menuName;
		this.menuStatus = menuStatus;
		this.menuLevel = menuLevel;
		this.menuIdP = menuIdP;
		this.menuUrl = menuUrl;
		this.menuIcon3 = menuIcon3;
		this.menuIcon2 = menuIcon2;
		this.menuIcon1 = menuIcon1;
	}

	// Property accessors

	@Id
	@Column(name = "MENU_ID", unique = true, nullable = false, length = 4)
	public String getMenuId() {
		return this.menuId;
	}

	public void setMenuId(String menuId) {
		this.menuId = menuId;
	}

	@Column(name = "MENU_NAME", nullable = false, length = 20)
	public String getMenuName() {
		return this.menuName;
	}

	public void setMenuName(String menuName) {
		this.menuName = menuName;
	}

	@Column(name = "MENU_STATUS", nullable = false, length = 1)
	public String getMenuStatus() {
		return this.menuStatus;
	}

	public void setMenuStatus(String menuStatus) {
		this.menuStatus = menuStatus;
	}

	@Column(name = "MENU_LEVEL", nullable = false, length = 1)
	public String getMenuLevel() {
		return this.menuLevel;
	}

	public void setMenuLevel(String menuLevel) {
		this.menuLevel = menuLevel;
	}

	@Column(name = "MENU_ID_P", nullable = false, length = 4)
	public String getMenuIdP() {
		return this.menuIdP;
	}

	public void setMenuIdP(String menuIdP) {
		this.menuIdP = menuIdP;
	}

	@Column(name = "MENU_URL", length = 80)
	public String getMenuUrl() {
		return this.menuUrl;
	}

	public void setMenuUrl(String menuUrl) {
		this.menuUrl = menuUrl;
	}

	@Column(name = "MENU_ICON3", length = 80)
	public String getMenuIcon3() {
		return this.menuIcon3;
	}

	public void setMenuIcon3(String menuIcon3) {
		this.menuIcon3 = menuIcon3;
	}

	@Column(name = "MENU_ICON2", length = 80)
	public String getMenuIcon2() {
		return this.menuIcon2;
	}

	public void setMenuIcon2(String menuIcon2) {
		this.menuIcon2 = menuIcon2;
	}

	@Column(name = "MENU_ICON1", length = 80)
	public String getMenuIcon1() {
		return this.menuIcon1;
	}

	public void setMenuIcon1(String menuIcon1) {
		this.menuIcon1 = menuIcon1;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof Menu))
			return false;
		Menu castOther = (Menu) other;

		return ((this.getMenuId() == castOther.getMenuId()) || (this
				.getMenuId() != null && castOther.getMenuId() != null && this
				.getMenuId().equals(castOther.getMenuId())))
				&& ((this.getMenuName() == castOther.getMenuName()) || (this
						.getMenuName() != null
						&& castOther.getMenuName() != null && this
						.getMenuName().equals(castOther.getMenuName())))
				&& ((this.getMenuStatus() == castOther.getMenuStatus()) || (this
						.getMenuStatus() != null
						&& castOther.getMenuStatus() != null && this
						.getMenuStatus().equals(castOther.getMenuStatus())))
				&& ((this.getMenuLevel() == castOther.getMenuLevel()) || (this
						.getMenuLevel() != null
						&& castOther.getMenuLevel() != null && this
						.getMenuLevel().equals(castOther.getMenuLevel())))
				&& ((this.getMenuIdP() == castOther.getMenuIdP()) || (this
						.getMenuIdP() != null && castOther.getMenuIdP() != null && this
						.getMenuIdP().equals(castOther.getMenuIdP())))
				&& ((this.getMenuUrl() == castOther.getMenuUrl()) || (this
						.getMenuUrl() != null && castOther.getMenuUrl() != null && this
						.getMenuUrl().equals(castOther.getMenuUrl())))
				&& ((this.getMenuIcon3() == castOther.getMenuIcon3()) || (this
						.getMenuIcon3() != null
						&& castOther.getMenuIcon3() != null && this
						.getMenuIcon3().equals(castOther.getMenuIcon3())))
				&& ((this.getMenuIcon2() == castOther.getMenuIcon2()) || (this
						.getMenuIcon2() != null
						&& castOther.getMenuIcon2() != null && this
						.getMenuIcon2().equals(castOther.getMenuIcon2())))
				&& ((this.getMenuIcon1() == castOther.getMenuIcon1()) || (this
						.getMenuIcon1() != null
						&& castOther.getMenuIcon1() != null && this
						.getMenuIcon1().equals(castOther.getMenuIcon1())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getMenuId() == null ? 0 : this.getMenuId().hashCode());
		result = 37 * result
				+ (getMenuName() == null ? 0 : this.getMenuName().hashCode());
		result = 37
				* result
				+ (getMenuStatus() == null ? 0 : this.getMenuStatus()
						.hashCode());
		result = 37 * result
				+ (getMenuLevel() == null ? 0 : this.getMenuLevel().hashCode());
		result = 37 * result
				+ (getMenuIdP() == null ? 0 : this.getMenuIdP().hashCode());
		result = 37 * result
				+ (getMenuUrl() == null ? 0 : this.getMenuUrl().hashCode());
		result = 37 * result
				+ (getMenuIcon3() == null ? 0 : this.getMenuIcon3().hashCode());
		result = 37 * result
				+ (getMenuIcon2() == null ? 0 : this.getMenuIcon2().hashCode());
		result = 37 * result
				+ (getMenuIcon1() == null ? 0 : this.getMenuIcon1().hashCode());
		return result;
	}

}